<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>递归</title>
</head>
<body>
<script>
    // fill(3, 4) 为 [4,4,4]
    var result = []
    function fill(size, num) {
        if(size<1){
            return result
        }
        result.push(num)
        size--
        return fill(size,num)
    }
console.log(fill(6,10))
</script>
</body>
</html>